import useFetchData from "../hooks/useData";
import React, { useState } from "react";

interface ShippingProps {
  country: string;
}
const Shipping: React.FC<ShippingProps> = props => {
  const { country } = props;
  const cities = useFetchData(`/api/cities?country=${country}`);
  const [city] = useState(null);
  const areas = useFetchData(`/api/areas?city=${city}`);

  return (
    <section>
      <h3>Shipping</h3>
      {cities}
      {areas}
    </section>
  );
};
export default Shipping;
